Build and x86/64 fixes.
Signed-off-by: keir.fraser@cl.cam.ac.uk
jws22@gauntlet.cl.cam.ac.uk
jws@cairnwell.research
kaf24@camelot.eng.3leafnetworks.com
+kaf24@firebug.cl.cam.ac.uk
kaf24@freefall.cl.cam.ac.uk
kaf24@labyrinth.cl.cam.ac.uk
kaf24@pb001.cl.cam.ac.uk
ifneq ($(TARGET_SUBARCH),x86_32)
OBJS := $(subst vmx.o,,$(OBJS))
OBJS := $(subst vmx_io.o,,$(OBJS))
+OBJS := $(subst vmx_platform.o,,$(OBJS))
OBJS := $(subst vmx_vmcs.o,,$(OBJS))
endif
lea start(%rip),%rax
sub $0x100000,%rax
add %rax,%rdi
- call cmain
+ call __start_xen
+ ud2 /* Force a panic (invalid opcode). */
/* This is the default interrupt handler. */
int_msg:
copy_from_user:
show_registers:
do_iopl:
-.globl idt_table, copy_user_generic, memcmp, idt_tables, new_thread
+.globl idt_table, copy_user_generic, idt_tables, new_thread
idt_table:
copy_user_generic:
-memcmp:
idt_tables:
new_thread:
.globl switch_to, __get_user_1, __get_user_4, __get_user_8, trap_init
l2_pgentry_t *mpl2e;
unsigned long mpfn;
- ASSERT( m->monitor_table );
-
mpl2e = (l2_pgentry_t *) map_domain_mem(pagetable_val(m->monitor_table));
/*
* First get the pfn for guest_pl2e_cache by looking at monitor_table
}
}
+#ifdef CONFIG_VMX
if (c->flags & ECF_VMX_GUEST)
return vmx_final_setup_guestos(d, c);
+#endif
return 0;
}
spin_unlock_recursive(&d->page_alloc_lock);
}
+#ifdef CONFIG_VMX
static void vmx_domain_relinquish_memory(struct exec_domain *ed)
{
struct domain *d = ed->domain;
}
}
+#endif
void domain_relinquish_memory(struct domain *d)
{
shadow_mode_disable(d);
/* Drop the in-use reference to the page-table base. */
- for_each_exec_domain(d, ed) {
+ for_each_exec_domain ( d, ed )
+ {
if ( pagetable_val(ed->mm.pagetable) != 0 )
put_page_and_type(&frame_table[pagetable_val(ed->mm.pagetable) >>
PAGE_SHIFT]);
}
- if (VMX_DOMAIN(d->exec_domain[0]))
- for_each_exec_domain(d, ed)
+#ifdef CONFIG_VMX
+ if ( VMX_DOMAIN(d->exec_domain[0]) )
+ for_each_exec_domain ( d, ed )
vmx_domain_relinquish_memory(ed);
+#endif
/*
* Relinquish GDT mappings. No need for explicit unmapping of the LDT as
return max_pfn;
}
-static void __init machine_specific_memory_setup(
- struct e820entry *raw, int raw_nr)
+#ifdef __i386__
+static void __init clip_4gb(void)
{
- char nr = (char)raw_nr;
int i;
- sanitize_e820_map(raw, &nr);
-
- (void)copy_e820_map(raw, nr);
-
-#ifdef __i386__
/* 32-bit systems restricted to a 4GB physical memory map. */
for ( i = 0; i < e820.nr_map; i++ )
{
e820.nr_map = i + 1;
}
}
+}
+#else
+#define clip_4gb() ((void)0)
#endif
+
+static void __init machine_specific_memory_setup(
+ struct e820entry *raw, int raw_nr)
+{
+ char nr = (char)raw_nr;
+ sanitize_e820_map(raw, &nr);
+ (void)copy_e820_map(raw, nr);
+ clip_4gb();
}
unsigned long init_e820(struct e820entry *raw, int raw_nr)
void __init init_frametable(void)
{
+#ifdef __i386__
unsigned long i, p;
frame_table = (struct pfn_info *)FRAMETABLE_VIRT_START;
}
memset(frame_table, 0, frame_table_size);
+#endif
}
void arch_init_memory(void)
.rodata : { *(.rodata) *(.rodata.*) } :text
.kstrtab : { *(.kstrtab) } :text
- . = ALIGN(16); /* Exception table */
+ . = ALIGN(32); /* Exception table */
__start___ex_table = .;
__ex_table : { *(__ex_table) } :text
__stop___ex_table = .;
- . = ALIGN(16); /* Pre-exception table */
+ . = ALIGN(32); /* Pre-exception table */
__start___pre_ex_table = .;
__pre_ex_table : { *(__pre_ex_table) } :text
__stop___pre_ex_table = .;
__init_begin = .;
.text.init : { *(.text.init) } :text
.data.init : { *(.data.init) } :text
- . = ALIGN(16);
+ . = ALIGN(32);
__setup_start = .;
.setup.init : { *(.setup.init) } :text
__setup_end = .;
.rodata : { *(.rodata) *(.rodata.*) } :text
.kstrtab : { *(.kstrtab) } :text
- . = ALIGN(16); /* Exception table */
+ . = ALIGN(32); /* Exception table */
__start___ex_table = .;
__ex_table : { *(__ex_table) } :text
__stop___ex_table = .;
- . = ALIGN(16); /* Pre-exception table */
+ . = ALIGN(32); /* Pre-exception table */
__start___pre_ex_table = .;
__pre_ex_table : { *(__pre_ex_table) } :text
__stop___pre_ex_table = .;
__init_begin = .;
.text.init : { *(.text.init) } :text
.data.init : { *(.data.init) } :text
- . = ALIGN(16);
+ . = ALIGN(32);
__setup_start = .;
.setup.init : { *(.setup.init) } :text
__setup_end = .;
#ifdef __x86_64__
extern unsigned long *machine_to_phys_mapping;
extern unsigned long *phys_to_machine_mapping;
+#define m2p_start_mfn virt_to_phys(machine_to_phys_mapping)
#else
/* Don't call virt_to_phys on this: it isn't direct mapped. Using
m2p_start_mfn instead. */
*/
typedef struct {
#define ECF_I387_VALID (1<<0)
+#define ECF_VMX_GUEST (2<<0)
unsigned long flags;
execution_context_t cpu_ctxt; /* User-level CPU registers */
char fpu_ctxt[512]; /* User-level FPU registers */